//
//  AdviseCollectionViewCell.m
//  Customized
//
//  Created by 陈凯旋 on 17/2/27.
//  Copyright © 2017年 陈凯旋. All rights reserved.
//

#import "AdviseCollectionViewCell.h"
#import <Masonry.h>

@interface AdviseCollectionViewCell ()

@property (nonatomic, strong) UILabel *titleLabel;

@end
@implementation AdviseCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame{

    if (self = [super initWithFrame:frame]) {
        
        self.backgroundColor = [UIColor clearColor];
        [self setupChildView];
    }
    

    return self;
}

- (void)setupChildView{
    
    self.titleLabel = [[UILabel alloc]init];
    self.titleLabel.textColor = [UIColor whiteColor];
    self.titleLabel.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:self.titleLabel];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.leading.mas_equalTo(self.contentView);
        make.top.mas_equalTo(self.contentView);
        make.bottom.mas_equalTo(self.contentView);
        
    }];
    
    UIView * line = [[UIView alloc]init];
    
    line.backgroundColor = [UIColor colorWithRed:90/255.0 green:190/255.0 blue:190/255.0 alpha:1];
    [self.contentView addSubview:line];
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.leading.mas_equalTo(self.titleLabel.mas_leading).offset(20);
        make.trailing.mas_equalTo(self.titleLabel.mas_trailing);
        make.top.mas_equalTo(self.titleLabel.mas_bottom);
        make.height.mas_equalTo(1);
    }];
    
}

- (void)setText:(NSString *)text{
    
    _text = text;
    self.titleLabel.text = text;
}
@end
